﻿Public Class Templates
    Dim fs As New FS
    Dim com As New Common
    Public templates As New ArrayList
    Public Sub loadTemplates()
        Dim template As Integer = 0
        If (fs.exists("Templates")) Then
            For Each foundFile As String In My.Computer.FileSystem.GetFiles(fs.Startup + "Templates")
                templates.Add(foundFile)
                Trace.WriteLine("[-] Found Template: " + foundFile)
                template = template + 1
            Next
            If (template = 0) Then
                com.Panic("DevBox could not find any templates!")
            End If
        Else
            com.Panic("Could not find Templates directory!")
        End If
    End Sub
    Public Sub generate()
        generateForm()
    End Sub
    Public Sub generateForm()
        Dim contents As String = My.Resources.form 'Takes the contents from the Form.txt resource
        fs.writeFile("Templates/form.designer.vb", contents) 'Passess it through to be written

    End Sub
End Class
